<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="handleChange">change</button>
        <img :src="imageSrc" alt="">
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                imageSrc:"./images/meinv.jpg"
            },
            methods: {
                handleChange:function(){
                    // 三元运算符
                    // 布尔值?返回值1:返回值2
                    this.imageSrc = this.imageSrc==="./images/shuaige.jpg"?"./images/meinv.jpg":"./images/shuaige.jpg"
                }
            },
        })
    </script>
</body>
</html>